package net.mymilkedeek.ludum.tinythumb;

import net.mymilkedeek.ludum.tinythumb.text.SpeakerText;
import net.mymilkedeek.ludum.tinythumb.util.Strings;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO: Write Documentation
 *
 * @author Michael Demey
 */
public class TextFactory {

    private Map<String, SpeakerText[]> textDatabase;

    public SpeakerText[] getText(String id) {
        if (textDatabase == null) {
            initDatabase();
        }
        return textDatabase.get(id);
    }

    private void initDatabase() {
        textDatabase = new HashMap<String, SpeakerText[]>();

        textDatabase.put("act-one", new SpeakerText[]{
                new SpeakerText(Strings.thumb, new String[]{
                        "Huh?",
                        "Where's my hand?"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "...",
                        "..."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "And... Umm...",
                        "Who are you?"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "-CHIRP-",
                        ""
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "",
                        ""
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "",
                        "I'm Chic the Chicken."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "What are you?",
                        "You don't look tasty."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "I'm a thumb. I kind",
                        "of lost my hand."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "-sigh-",
                        ""
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "",
                        "-CHIRP-"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "",
                        "I'm Chic the Chicken."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "Yeah. I get it.",
                        "You're a chicken."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "",
                        "Weeelllll...."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        " .__. ",
                        ""
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "Do you at least",
                        "know the way to"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "the human city?",
                        ""
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "Of course.",
                        "I'll take you!"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "-sigh-",
                        "OK, then, let's go."
                }),
                new SpeakerText(Strings.game, new String[]{
                        "Chic joined your",
                        "PARTY"
                }),
                new SpeakerText(Strings.game, new String[]{
                        "<   press F1 to  >",
                        "< view help menu >"
                }),
                new SpeakerText(Strings.game, new String[]{
                        "<  and controls  >",
                        "<      ~MME      >"
                })
        });

        textDatabase.put("event-one", new SpeakerText[]{
                new SpeakerText(Strings.thumb, new String[]{
                        "",
                        "What's this?"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "Barbed wire?",
                        "And a gnome village?"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "Yeah...",
                        "This is BouterTown."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "It wasn't always",
                        "this. It used to "
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "be a circle of",
                        "mushrooms."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "",
                        "..."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "And what's the deal",
                        "with the barbed wire?"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "Oh. I think it's",
                        "used to keep"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "outsiders outside.",
                        ""
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "...",
                        ""
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "-sigh-",
                        "We'd better press on."
                })
        });

        textDatabase.put("gnome", new SpeakerText[]{
                new SpeakerText(Strings.gnome_text, new String[]{
                        "Grmmbl",
                        "Who's this again?"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "It is I.",
                        "Chic the Chicken."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "Are you sure you",
                        "should be introducing"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "yourself like that?",
                        "Chic the Chicken."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "",
                        "What do you mean?"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "I mean,",
                        "We can see you're a"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "chicken. No need",
                        "to point it out."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "True, true.",
                        "But what if our friend"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "here couldn't see",
                        "this obvious fact?"
                }),
                new SpeakerText(Strings.gnome_text, new String[]{
                        "He has a point.",
                        "But what I was"
                }),
                new SpeakerText(Strings.gnome_text, new String[]{
                        "",
                        "grmmbling about..."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "And furthermore,",
                        "Mr. Thumb,"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "Shut up.",
                        "       Yeah."
                }),
                new SpeakerText(Strings.gnome_text, new String[]{
                        "Oy!",
                        "You're in my town."
                }),
                new SpeakerText(Strings.gnome_text, new String[]{
                        "GET",
                        "OUT"
                })
        });

        textDatabase.put("moon", new SpeakerText[]{
                new SpeakerText(Strings.chicken, new String[]{
                        "Thumb?",
                        "Why do you want to"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "find your hand?",
                        "I mean, it's not as"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "if it's looking for",
                        "you. Clearly it doesn't..."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "-sigh-",
                        "You're Chic, the chicken."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "I guess, no, I know",
                        "you wouldn't understand"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "how it feels to be part",
                        "of something bigger."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "You don't have to be an",
                        "ass about it."
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "Sure, you got separated",
                        "from what you were"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "but your newfound",
                        "independence must be"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "something I wouldn't",
                        "throw away, were the"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "choice mine to make.",
                        "But what do I know,"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "I'm just",
                        "Chic the Chicken."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "",
                        "... "
                })
        });

        textDatabase.put("end", new SpeakerText[] {
                new SpeakerText(Strings.chicken, new String[]{
                        "We're here.",
                        "The human city is"
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "a few tiny miles",
                        "down this road."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "Well...",
                        "I'm not sure what"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "do right now.",
                        "This has been such"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "a long journey.",
                        "..."
                }),
                new SpeakerText(Strings.foot_text, new String[]{
                        "",
                        ""
                }),
                new SpeakerText(Strings.chicken, new String[]{
                        "",
                        "..."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "What?",
                        "Don't tell me you"
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "emotional now?",
                        "What?"
                }),
                new SpeakerText(Strings.foot_text, new String[]{
                        "",
                        ""
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "",
                        "..."
                }),
                new SpeakerText(Strings.thumb, new String[]{
                        "",
                        "-SIGH-"
                })
        });
    }
}
